<template>
  <!-- 我的报价 -->
  <view class="container">
    <view id="comf" class="header">
      <u-tabs-swiper
        height="90"
        bar-width="78"
        :show-bar="false"
        inactive-color="#666666"
        bar-height="10"
        active-color="#FBB000"
        ref="uTabs"
        :list="titleList"
        :current="tabIndex"
        @change="tabsChange"
        :is-scroll="false"
      ></u-tabs-swiper>
    </view>
    <!--报价列表-->
    <view v-show="tabIndex === 0">
      <view class="looking-car" v-show="!showimg">
        <scroll-view scroll-y class="scroll" @scrolltolower="getList"
          ><page-loading :show="pageLoading">
            <quote-list-card
              v-for="(item, index) in list"
              :key="index"
              :info="item"
            ></quote-list-card>
            <view v-show="isEnd" class="end"
              >-- 已经到底了 --</view
            ></page-loading
          >
        </scroll-view>
      </view>

      <!-- 无内容默认图片 -->
      <view v-show="showimg">
        <defaultImg msg="暂无报价"></defaultImg>
      </view>
    </view>

    <!--    聊天-->
    <view v-show="tabIndex === 1">
      <scroll-view v-show="!showDefault" scroll-y class="im-box">
        <view v-if="IMlist.length">
          <u-swipe-action
            class="u-skeleton-rect"
            v-for="(item, index) in IMlist"
            :key="item.conversationID"
            :show="index === openIndex"
            :options="options"
            :btn-width="btnWidth"
            @content-click="contentClick(index)"
            @close="close"
            @click="deleteFn"
          >
            <view
              class="item u-border-bottom"
              :class="index === openIndex ? 'bg-f6' : 'bg-fff'"
              ><view class="icon-left">
                <image
                  v-if="item.img"
                  class="img"
                  mode="aspectFill"
                  :src="item.img"
                />
                <image
                  v-else
                  class="img"
                  mode="aspectFill"
                  src="@/static/logo/bussinesslogo.png"
                />
              </view>
              <view class="title-wrap">
                <view class="title">
                  <text class="title-left">{{ item.user }}</text>
                  <text class="title-right">{{
                    $u.timeFrom(item.lastTime, 'YYYY-mm-dd')
                  }}</text>
                </view>
                <view class="title">
                  <view class="xiaoxiss">
                    <rich-text
                      :nodes="nodesFliter(item.messageForShow)"
                    ></rich-text>
                  </view>
                  <view class="sub-right" v-if="item.unreadCount > 0">{{
                    item.unreadCount
                  }}</view>
                </view>
              </view>
            </view>
          </u-swipe-action>
        </view>
      </scroll-view>
      <!-- 无内容默认图片 -->
      <view v-show="showDefault">
        <defaultImg msg="暂无聊天记录"></defaultImg>
      </view>
    </view>
  </view>
</template>

<script src="./myQuoteList.js"></script>
<style lang="scss" scoped>
@import './myQuoteList.scss';
</style>
